---
feature_name: Network Information API
chrome_version: 65
feature_id: 6338383617982464
---

<h3>Background</h3>
<p>
  This demo illustrates the use of the
  <a href="http://w3c.github.io/netinfo/">Network Information API</a>
  to retrieve the current network type and monitor for network type changes.
</p>

<p>
  While it was previously limited to Chrome on Android or on ChromeOS, the
  Network Information API is now available for Chrome on all platforms, though
  meaningful values for
  <a href="http://wicg.github.io/netinfo/#-dfn-networkinformation-dfn-interface">all of the properties</a>
  might not be available on every platform.
</p>

<p>
  This code sample reflects the most recent implementation of the API, including
  the <code>connection.downlinkMax</code> attribute, support for the
  <code>'wimax'</code> connection type, and <code>connection.onchange</code>
  event listener. (The older <code>connection.ontypechange</code> event listener
  should no longer be used.)
</p>

{% include output_helper.html %}

<script>
  var times = 1;
  var log = function(args) {
    ChromeSamples.log(args);
    if (times % 5 == 0) {
      ChromeSamples.log('');
    }
    times++;
  }
</script>

{% include js_snippet.html filename='demo.js' %}
